<?php

class Config extends Singleton {
	private static $settings = array();

	/**
	 * Enables singleton working properly
	 *
	 * @see singleton.php
	 */
	public static function instance()
	{
		return self::getInstanceOf( get_class() );
	}

	public static function setup() {
		Config::instance()->settings['files_directory'] = 'files';
		Config::instance()->settings['siblings'] = array(
			array(
				'type' => 'public',
				'secret' => '',
				'url' => 'http://localhost/mp-test/',
			),
			array(
				'type' => 'private',
				/** SHA-1 hash of 'mirrorpress_shared secret' */
				'secret' => 'e9eac951c6f8537d6f3e01c47257244a956fc93a',
				'url' => 'http://localhost/mp-test-2/',
			),
		);
	}

	/**
	 *
	 */
	public static function get($option) {
		if( !isset(Config::instance()->settings[$option]) )
			return null;
		return Config::instance()->settings[$option];
	}
}